<?php

class Admin_IndexController extends Zend_Controller_Action
{

    public function init()
    {
        $option=array( 
        	"layout" => "layout", 
        	"layoutPath" => APPLICATION_PATH."/layouts/scripts/" 
      	); 
      	Zend_Layout::startMvc($option); 
        	$this->view->headTitle("CMS"); 
    }

    public function indexAction()
    {
    	
    }
    
    //Login khi chua Login thanh cong
	public function preDispatch() {
	    $auth = Zend_Auth::getInstance();
	    if (!$auth->hasIdentity()) {
	        if ($this->_request->getActionName() != 'login') {
	            $this->_redirect('/admin/login');
	        }
	    }
	}	
}

